home *** CD-ROM | disk | FTP | other *** search
/ Ham Radio 2000 #1 / Ham Radio 2000.iso / ham2000 / packet / terminal / winpack / wpext / aakext.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-06-02  |  1.5 KB  |  54 lines

  1. /* An example external program for Winpack 5.4 */
  2. /* By Andy Keir May 1996 */
  3.  
  4. #include <stdio.h>
  5. #include <string.h>
  6. main(int argc, char *argv[])
  7. {
  8.  
  9.     /*  The command line arguments are as follows */
  10.     /*  The number of command line arguments is argc */
  11.     /*  The full name and path of the calling program is argv[0] */
  12.     /*  The status number is argv[1] */
  13.     /*  The callsign of this station is argv[2] */
  14.     /*  The name of the operator of this station is argv[3] */
  15.     /*  The callsign of the connected station is argv[4] */
  16.     /*  The first word of the user text is argv[5] */
  17.  
  18.  
  19.     /* convert the command line arguments to upper case for consistency */
  20.  
  21.     strupr(argv[2]);
  22.     strupr(argv[3]);
  23.     strupr(argv[4]);
  24.     strupr(argv[5]);
  25.     
  26.     /**************************************************/
  27.     /* your own actual useful program stuff goes here */
  28.     /**************************************************/
  29.  
  30.     {
  31.     /* open the response file and write some stuff to it */
  32.  
  33.     FILE *fp;
  34.     if( (fp = fopen("extern\\aakext.rep","w" )) != NULL )
  35.     {       
  36.         fputs( "-1" , fp );
  37.         fputc( '\n', fp );
  38.         fputs( "AAKEXT - an example external program for Winpack" ,fp );
  39.         fputc( '\n', fp );
  40.         fprintf(fp, "The program was invoked by %s",argv[4]);
  41.         fputc( '\n', fp );            
  42.         fprintf(fp, "The user command line text is %s",argv[5]);
  43.         fputc( '\n', fp );            
  44.         fclose( fp );
  45.     }
  46.     else
  47.         printf( "an error occurred opening the response file\n" );
  48.     }
  49.  
  50.  
  51. }
  52.  
  53.  
  54.